From: Carlos Garnacho Date: Sun, 13 Feb 2022 13:05:41 +0000 (+0100) Subject: popupMenu: Avoid open state reentrancy in dummy menus X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~16 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=89db7bbb120b5874bd94cdeb1992712513281b26;p=gnome-shell.git popupMenu: Avoid open state reentrancy in dummy menus Dummy menus may emit ::open-state-changed multiple times for the same state. Avoid doing that so that the PopupMenuManager is happy not having to handle reentrancy. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5064 Part-of: --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index f30c01146..5908f7a29 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -994,10 +994,16 @@ var PopupDummyMenu = class { } open() { + if (this.isOpen) + return; + this.isOpen = true; this.emit('open-state-changed', true); } close() { + if (!this.isOpen) + return; + this.isOpen = false; this.emit('open-state-changed', false); }